*********************
* G1 book - chapter 4 *
*********************


use "Elites five countries all GGIs.dta"

mean confios
mean confgov
ttest confios==confgov


* analysis of non-response
tab confIOs, missing
tab confICC, missing
tab confIMF, missing
tab confUN, missing
tab confWB, missing
tab confWHO, missing
tab confWTO, missing
tab confgov, missing


* Figure 4.1 - confidence per IO countries pooled
**************************************************

use "\Elites five countries all GGIs.dta"

drop confEU confASEAN confNAFTA confMERCOSUR confSCO confUNFCCC confUNSC confG20 confICANN confFSC confKP confFIFA confNATO confAU

preserve
gen id=_n
reshape long conf, i(id) j(io) string  
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
drop if io=="REGIO"
encode io, gen(ionum)

#delimit ;
graph bar conf , 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle(Average confidence) 
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.1.gph, replace)
;
#delimit cr


* text 'Patterns by Organization'

* confidence in IMF is significantly lower than in all other institutions
ttest confIMF==confWTO
ttest confIMF==confWB
ttest confIMF==confICC
ttest confIMF==confUN
ttest confIMF==confWHO

* confidence in WB is signficiantly different from the two closest IOs, so from all other institutions
ttest confWB==confWTO
ttest confWB==confICC
ttest confWB==confUN

* confidence WTO is signficnatly different from all other institutions
ttest confWTO==confWB

* confidence in WHO is signficiantly higher than in all other institutions
ttest confWHO==confUN

* not sign different
ttest confUN==confICC






*Figure 4.2 - Distribution plots
******************************************
use "Elites five countries all GGIs.dta"

drop confEU confASEAN confNAFTA confMERCOSUR confSCO confUNFCCC confUNSC confG20 confICANN confFSC confKP confFIFA confNATO 

cd ""


label define confidence 0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", modify
label values confgov confidence
label values confWHO confidence
label values confWTO confidence
label values confWB confidence
label values confUN confidence
label values confIMF confidence
label values confICC confidence
tab confgov


preserve 
contract confUN, freq(totalno) percent(percent)
#delimit ;
graph bar percent, 
 over(confUN, label(labcolor(black)  labsize(small))) 
 legend(col(1) size(medsmall))
 ytitle("") title(UN) 
 ylabel(0 "0%" 20 "20%" 40 "40%" 60 "60%")
    blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.2_un.gph, replace)
 yvaroptions(relabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 
3 "A great deal")) 
;
#delimit cr

preserve
contract confWB, freq(totalno) percent(percent)
#delimit ;
graph bar percent, 
 over(confWB, label(labcolor(black)  labsize(small))) 
 legend(col(1) size(medsmall))
 ytitle("") title(World Bank)
 ylabel(0 "0%" 20 "20%" 40 "40%" 60 "60%")
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.2_wb.gph, replace)
 yvaroptions(relabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 
3 "A great deal")) 
;
#delimit cr

preserve 
contract confICC, freq(totalno) percent(percent)
#delimit ;
graph bar percent, 
 over(confICC, label(labcolor(black)  labsize(small))) 
 legend(col(1) size(medsmall))
 ytitle("") title(ICC)
 ylabel(0 "0%" 20 "20%" 40 "40%" 60 "60%")
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.2_icc.gph, replace)
 yvaroptions(relabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 
3 "A great deal")) 
;
#delimit cr

preserve 
contract confIMF, freq(totalno) percent(percent)
#delimit ;
graph bar percent, 
 over(confIMF, label(labcolor(black)  labsize(small))) 
 legend(col(1) size(medsmall))
 ytitle("") title(IMF)
 ylabel(0 "0%" 20 "20%" 40 "40%" 60 "60%")
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.2_imf.gph, replace)
 yvaroptions(relabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 
3 "A great deal")) 
;
#delimit cr

preserve 
contract confWHO, freq(totalno) percent(percent)
#delimit ;
graph bar percent, 
 over(confWHO, label(labcolor(black)  labsize(small))) 
 legend(col(1) size(medsmall))
 ytitle("") title(WHO)
 ylabel(0 "0%" 20 "20%" 40 "40%" 60 "60%")
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.2_who.gph, replace)
 yvaroptions(relabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 
3 "A great deal")) 
;
#delimit cr

preserve 
contract confWTO, freq(totalno) percent(percent)
#delimit ;
graph bar percent, 
 over(confWTO, label(labcolor(black)  labsize(small))) 
 legend(col(1) size(medsmall))
 ytitle("") title(WTO)
 ylabel(0 "0%" 20 "20%" 40 "40%" 60 "60%")
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.2_wto.gph, replace)
 yvaroptions(relabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 
3 "A great deal")) 
;
#delimit cr

preserve 
contract confgov, freq(totalno) percent(percent)
#delimit ;
graph bar percent, 
 over(confgov, label(labcolor(black)  labsize(small))) 
 legend(col(1) size(medsmall))
ytitle("") title(Government)
 ylabel(0 "0%" 20 "20%" 40 "40%" 60 "60%")
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.2_gov.gph, replace)
 yvaroptions(relabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 
3 "A great deal")) 
;
#delimit cr

graph combine fig4.2_icc.gph fig4.2_imf.gph fig4.2_un.gph fig4.2_wb.gph  fig4.2_who.gph fig4.2_wto.gph fig4.2_gov.gph, ycommon col(2)





* Figure 4.3 - confidence in GGIs
***************************************

use "Elites five countries all GGIs.dta"

drop confASEAN confEU confSCO confMERCOSUR confNAFTA
 
preserve
gen id=_n
reshape long conf, i(id) j(io) string 
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
replace io="Region." if io=="REGIO"
encode io, gen(ionum)

#delimit ;
graph bar conf , 
 over(ionum, sort(conf) descending label(labcolor(black) alternate labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle(Average confidence) 
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.3.gph, replace)
;
#delimit cr


* text on Figure 4.3
tab confICANN, missing
tab confFSC, missing
tab confKP, missing
tab confREGIO, missing
tab confFIFA, missing
tab confUNFCCC, missing
tab confUNSC, missing
tab confG20, missing
tab confNATO, missing

ttest confICC==confUNFCCC
ttest confUN==confUNFCCC

gen confGGIs= (confICANN+confFSC+confKP+confFIFA+confUNFCCC+confUNSC+confG20+confNATO+confICC+confWTO+confWB+confWHO+confUN+confIMF)/14
sum confGGIs

ttest confGGIs == confios

ttest confUN==confICC
ttest confUN==confUNFCCC
ttest confICC==confUNFCCC
ttest confICC==confICANN
ttest confUNFCCC==confICANN
ttest confUNFCCC==confWB
ttest confICANN==confWB
ttest confICANN==confFSC
ttest confICANN==confUNSC
ttest confWB==confFSC
ttest confWB==confUNSC
ttest confWB==confWTO
ttest confWB==confG20
ttest confFSC==confUNSC
ttest confFSC==confWTO
ttest confFSC==confG20
ttest confUNSC==confWTO
ttest confUNSC==confG20
ttest confWTO==confICANN
ttest confWTO==confG20
ttest confWTO==confIMF
ttest confWTO==confNATO
ttest confG20==confIMF
ttest confG20==confNATO
ttest confG20==confKP
ttest confIMF==confNATO
ttest confIMF==confKP
ttest confIMF==confICANN 
ttest confIMF==confFSC
ttest confIMF==confUNSC
ttest confNATO==confKP
ttest confKP== confFIFA 
ttest confKP==confIMF 


mean confREGIO

* confidence by institution type

gen confintorg= (confWHO+confUN+confICC+confUNFCCC+confWB+confUNSC+confWTO+confIMF+confNATO)/9
mean confintorg

gen confmulti = (confFSC+confICANN+confKP)/3
mean confmulti


* non-response

tab confICANN, missing
tab confFSC, missing
tab confKP, missing


* confidence by issue area

gen confecon3= (confWB+confWTO+confIMF)/3
mean confecon3
gen confecon = (confICANN+confWB+confWTO+confIMF)/4
mean confecon

gen confhumsec3 = (confICC+confWHO+confUN)/3
gen confhumsec = (confICC+confWHO+confUN+confUNFCCC+confUNSC+confNATO+confKP)/7
mean confhumsec3
mean confhumsec

ttest confhumsec3==confhumsec

mean confNATO if country==76
mean confNATO if country==608
mean confNATO if country==643


* Figure 4.4 - confios by country
***********************************

use "Elites six countries all GGIs.dta"

preserve
collapse confios, by(country)
reshape long conf, i(country) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)

tab country, nol
label define label_country 76 "Brazil"  608 "Philippines" 276 "Germany" 
710 "South Africa" 840 "US" 643 "Russia", modify
label values country label_country

#delimit ;
graph bar conf, 
 over(country, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle(Average confidence) 
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.4.gph, replace)
;
#delimit cr

**

ttest confios==1.91 if (country==76) // BR-DE 
ttest confios==1.89 if (country==608) //PH-DE
ttest confios==1.89 if (country==840) //US-DE
ttest confios==1.77 if (country==840) // PH-US
ttest confios==1.74 if (country==643) // RU-US
ttest confios==1.74 if (country==710) // RU-US
ttest confios==1.55 if (country==710) // SA-RU


* comparison between established and (re)emergent powers

mean confios if (country==276| country==840)
mean confios if (country==76| country==643 |country==710)








* Figure 4.5
************************************************


use "Elites six countries all GGIs.dta"

mean confWHO if country==76

preserve
collapse confgov confios confUN confIMF confICC confWB confWHO confWTO, by(country)
reshape long conf, i(country) j(io) string 
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if country==76 // Brazil

#delimit ;
graph bar conf, 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(Brazil)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.5_BR.gph, replace)
;
#delimit cr


preserve
collapse confgov confios confUN confIMF confICC confWB confWHO confWTO, by(country)
reshape long conf, i(country) j(io) string 
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if country==608 // Philippines

#delimit ;
graph bar conf, 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(Philippines)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.5_PH.gph, replace)
;
#delimit cr


preserve
collapse confgov confios confUN confIMF confICC confWB confWHO confWTO, by(country)
reshape long conf, i(country) j(io) string 
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if country==276 // Germany

#delimit ;
graph bar conf, 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(Germany)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.5_DE.gph, replace)
;
#delimit cr


preserve
collapse confgov confios confUN confIMF confICC confWB confWHO confWTO, by(country)
reshape long conf, i(country) j(io) string 
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if country==710 // South Africa

#delimit ;
graph bar conf, 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(South Africa)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.5_SA.gph, replace)
;
#delimit cr


preserve
collapse confgov confios confUN confIMF confICC confWB confWHO confWTO, by(country)
reshape long conf, i(country) j(io) string 
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if country==840 // USA

#delimit ;
graph bar conf, 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(US)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.5_US.gph, replace)
;
#delimit cr


preserve
collapse confgov confios confUN confIMF confICC confWB confWHO confWTO, by(country)
reshape long conf, i(country) j(io) string 
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if country==643 // Russia

#delimit ;
graph bar conf, 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(Russia)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.5_RU.gph, replace)
;
#delimit cr



graph combine fig4.5_BR.gph fig4.5_DE.gph fig4.5_PH.gph fig4.5_RU.gph fig4.5_SA.gph fig4.5_US.gph  , ycommon col(2) saving(fig4.5.gph, replace)
 
 
  
  
  

* Figure 4.6
*****************************


use "Elites six countries all GGIs.dta"

keep confgov confUN confIMF confICC confWB confWHO confWTO country 

tab country, nol
label define label_country 76 "Brazil"  608 "Philippines" 276 "Germany" 710 "South Africa" 840 "US" 643 "Russia", modify
label values country label_country

preserve 
gen id=_n
reshape long conf, i(id) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if ionum==1 // government **


#delimit ;
graph bar conf, 
 over(country, sort(conf) descending label(labcolor(black) labsize(vsmall))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(Government)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.6_gov.gph, replace)
;
#delimit cr



preserve
gen id=_n
reshape long conf, i(id) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if ionum==3 // IMF **

#delimit ;
graph bar conf, 
 over(country, sort(conf) descending label(labcolor(black) labsize(vsmall))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(IMF)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.6_IMF.gph, replace)
;
#delimit cr

preserve
gen id=_n
reshape long conf, i(id) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if ionum==5 // WB **

#delimit ;
graph bar conf, 
 over(country, sort(conf) descending label(labcolor(black) labsize(vsmall))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(World Bank)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.6_WB.gph, replace)
;
#delimit cr


preserve
gen id=_n
reshape long conf, i(id) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if ionum==6 // WHO **

#delimit ;
graph bar conf, 
 over(country, sort(conf) descending label(labcolor(black) labsize(vsmall))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(WHO)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.6_WHO.gph, replace)
;
#delimit cr


preserve
gen id=_n
reshape long conf, i(id) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if ionum==7 // WTO **

#delimit ;
graph bar conf, 
 over(country, sort(conf) descending label(labcolor(black) labsize(vsmall))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(WTO)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.6_WTO.gph, replace)
;
#delimit cr


preserve
gen id=_n
reshape long conf, i(id) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if ionum==4 // UN **

#delimit ;
graph bar conf, 
 over(country, sort(conf) descending label(labcolor(black) labsize(vsmall))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(UN)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.6_UN.gph, replace)
;
#delimit cr


preserve
gen id=_n
reshape long conf, i(id) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if ionum==2 // ICC **

#delimit ;
graph bar conf, 
 over(country, sort(conf) descending label(labcolor(black) labsize(vsmall))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(ICC)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.6_ICC.gph, replace)
;
#delimit cr

graph combine fig4.6_ICC.gph fig4.6_IMF.gph fig4.6_UN.gph fig4.6_WB.gph fig4.6_WHO.gph fig4.6_WTO.gph  fig4.6_gov.gph, ycommon col(2) saving(fig4.6.gph, replace)







  
* Figure 4.7 - confidence by sector
************************************************
 
use "Elites five countries all GGIs.dta"

preserve
collapse confios, by(elitecat)
reshape long conf, i(elitecat) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)


#delimit ;
graph bar conf, 
 over(elitecat, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle(Average confidence) 
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.7_pooled.gph, replace)
;
#delimit cr

**
ttest confios==1.78 if elitecat==6
ttest confios==1.78 if elitecat==5
ttest confios==1.78 if elitecat==4
ttest confios==1.78 if elitecat==1

ttest confios==1.94 if elitecat==3


 
* Figure 4.8 - confidence in each IO in each sector
************************************************


use "Elites five countries all GGIs.dta"


preserve
collapse confgov confios confUN confIMF confICC confWB confWHO confWTO, by(elitecat)
reshape long conf, i(elitecat) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if elitecat==1 // Partisan-political

#delimit ;
graph bar conf, 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(Partisan-political)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.8_partisan.gph, replace)
;
#delimit cr




preserve
collapse confgov confios confUN confIMF confICC confWB confWHO confWTO, by(elitecat)
reshape long conf, i(elitecat) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if elitecat==2 //Bureaucratic

#delimit ;
graph bar conf, 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(Bureaucratic)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.8_bureau.gph, replace)
;
#delimit cr


preserve
collapse confgov confios confUN confIMF confICC confWB confWHO confWTO, by(elitecat)
reshape long conf, i(elitecat) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if elitecat==3 // Civil society

#delimit ;
graph bar conf, 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(Civil society)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.8_civil.gph, replace)
;
#delimit cr


preserve
collapse confgov confios confUN confIMF confICC confWB confWHO confWTO, by(elitecat)
reshape long conf, i(elitecat) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if elitecat==4 // Media

#delimit ;
graph bar conf, 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(Media)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.8_media.gph, replace)
;
#delimit cr


preserve
collapse confgov confios confUN confIMF confICC confWB confWHO confWTO, by(elitecat)
reshape long conf, i(elitecat) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if elitecat==5 // Business
#delimit ;
graph bar conf, 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(Business)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.8_business.gph, replace)
;
#delimit cr


preserve
collapse confgov confios confUN confIMF confICC confWB confWHO confWTO, by(elitecat)
reshape long conf, i(elitecat) j(io) string 
ed
replace io="All IOs" if io=="ios"
replace io="Gov." if io=="gov"
encode io, gen(ionum)
keep if elitecat==6 // Research

#delimit ;
graph bar conf, 
 over(ionum, sort(conf) descending label(labcolor(black) labsize(small))) 
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 ytitle("") title(Research)
 bar(1, fcolor(gs14) fintensity(100)) 
 bar(2, fcolor(gs8) fintensity(100)) 
 bar(3, fcolor(gs2) fintensity(100)) 
 blabel(bar, format(%9.2f) size(small) lcolor(none)) saving(fig4.8_research.gph, replace)
;
#delimit cr



graph combine fig4.8_partisan.gph fig4.8_bureau.gph fig4.8_civil.gph fig4.8_media.gph fig4.8_business.gph fig4.8_research.gph  , ycommon col(2) saving(fig4.8.gph, replace)


ttest confgov==1.55 if elitecat==3
